package com.yupi.yoj.judge.codesandbox.factory;

import com.yupi.yoj.judge.codesandbox.CodeSandbox;
import com.yupi.yoj.judge.codesandbox.impl.ExampleCodeSandBox;
import com.yupi.yoj.judge.codesandbox.impl.RemoteCodeSandBox;
import com.yupi.yoj.judge.codesandbox.impl.ThirdPartCodeSandBox;
import org.springframework.stereotype.Component;

@Component
public class CodeSandBoxFactory {
    public static CodeSandbox newInstance(String flag) {
        switch (flag) {
            case "example":
                return new ExampleCodeSandBox();
            case "remote":
                return new RemoteCodeSandBox();
            case "thirdpart":
                return new ThirdPartCodeSandBox();
        }
        return new ExampleCodeSandBox();
    }
}
